import React, { Component } from "react";
import { Switch, Route, Redirect, Link } from "react-router-dom";
import { Menu } from "antd";
import taskhome from "./home";
import "./task.less";
import ics from "./Ics";
import database from "./database";
import baseline from "./baseline";
import Sitetoscan from "./Sitetoscan";
import zujidetaile from "./zujidetaile";
import lookhost from "./lookhost";
import icsdetail from "./icsdetail";
import icsnew from "./icsnew";
import databasenew from "./databasenew";
import databasedetaile from "./databasedetaile";
import baselinenew from "./baselinenew";
import baselinedetaile from "./baselinedetaile";
import Sitetoscandetaile from "./Sitetoscandetaile";
import Sitetoscannew from "./Sitetoscannew";
class task extends Component {
  constructor(props) {
    super(props);
    this.state = {
      current: "1",
    };
  }
  handleClick = (e) => {
    console.log("click ", e);
    this.setState({
      current: e.key,
    });
  };
  render() {
    return (
      <div>
        <Menu
          className="nav"
          onClick={this.handleClick}
          selectedKeys={[this.state.current]}
          mode="horizontal"
        >
          <Menu.Item key="1">
            <Link to="/task">主机扫描</Link>
          </Menu.Item>
          <Menu.Item key="2">
            <Link to="/task/ics">工控扫描</Link>
          </Menu.Item>
          <Menu.Item key="3">
            <Link to="/task/database">数据库扫描</Link>
          </Menu.Item>
          <Menu.Item key="4">
            <Link to="/task/baseline">基线扫描</Link>
          </Menu.Item>
          <Menu.Item key="5">
            <Link to="/task/Sitetoscan">网站扫描</Link>
          </Menu.Item>
        </Menu>

        <Switch>
          <Route path="/task" component={taskhome} exact />
          <Route path="/task/ics" component={ics} />
          <Route path="/task/database" component={database} />
          <Route path="/task/baseline" component={baseline} />
          <Route path="/task/Sitetoscan" component={Sitetoscan} />
          <Route path="/task/Sitetoscannew" component={Sitetoscannew} />
          <Route path="/task/Sitetoscandetaile" component={Sitetoscandetaile} />
          <Route path="/task/zujidetaile" component={zujidetaile} />
          <Route path="/task/lookhost" component={lookhost} />
          <Route path="/task/icsdetail" component={icsdetail} />
          <Route path="/task/icsnew" component={icsnew} />
          <Route path="/task/databasenew" component={databasenew} />
          <Route path="/task/databasedetaile" component={databasedetaile} />
          <Route path="/task/baselinenew" component={baselinenew} />
          <Route path="/task/baselinedetaile" component={baselinedetaile} />
          <Redirect to="/task" />
        </Switch>
      </div>
    );
  }
}

export default task;
